# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: arjan <arjan@archlinux.org>

pkgname=allegro4
pkgver=4.4.3.1
pkgrel=3
pkgdesc='Portable library aimed at video game and multimedia programming (legacy version)'
arch=(loong64 x86_64)
url='https://liballeg.org/'
license=(custom)
depends=(jack libxcursor libxpm libxxf86vm)
makedepends=(cmake glu libpng mesa ninja)
options=(staticlibs)
source=("https://github.com/liballeg/allegro5/releases/download/$pkgver/allegro-$pkgver.tar.gz"
        LICENSE)
sha256sums=('ec19dbc9a021244582b4819b3583ee594b50141f9fcf6944a4ed8069cbf8d4d4'
            '76b9cd52eab572495e8b3b64313d8e40c0359135491e981321d15c3e707ba41a')

build() {
  mkdir -p build
  cd build
  cmake "$srcdir/allegro-$pkgver" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DWANT_DOCS=OFF \
    -GNinja
  ninja
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
  install -Dm644 "allegro-$pkgver/misc/allegro.m4" \
    "$pkgdir/usr/share/aclocal/allegro.m4"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim: ts=2 sw=2 et:
